<template>
  <div class="table-wrapper">
    <table class="table">
      <thead>
        <tr>
          <th></th>
          <th></th>
          <th v-for="index in 10" :key="index">
						<t-select @change="handleChange" placeholder="请选择"
							class="demo-select-base" :keys="{ label: 'label', value: 'value' }" clearable>
							<t-option v-for="(item, index) in options1" :key="index" :value="item.value"
								:label="item.label">
								{{ item.label }}
							</t-option>
						</t-select>
          </th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>TPS</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>调优建议</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
      </tbody>
    </table>
  </div>
</template>



<style scoped>
.table-wrapper {
  margin-top: 20px;
}

.table {
  border-collapse: collapse;
  border: 1px solid #ccc;
  width: 100%;
}

th, td {
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 14px;
}

th {
  background-color: #f5f5f5;
}

td:hover {
  background-color: #f5f5f5;
}
</style>
  

<script lang="jsx">
import Vue from 'vue';
import { prefix } from '@/config/global';
import { REPORT_LIST } from '@/service/service-detail';
import {
  getSceneList
	} from '@/api/requestApi';

export default {
  data() {
    return {
      options1: [],
    };
  },
  created() {
    this.getSceneList1()
  },
  mounted() {

  },
  methods: {
    handleChange(value) {
				console.log(this.formData)
				console.log(value)
				this.getApiTest()
			},
    getApiTest() {
      this.$request
        .get(getTest(), { 
          params: this.formData
        })
        .then((res) => {
          console.log(res)
          if (res.code == '0') {
            const list = res.data.list;
            this.testCaseVersion = list;
          } else {
            this.$message.error(res.data.msg);
          }
        })
        .catch((e) => {
          this.$message.error('系统异常');
        })
        .finally(() => {});
    },

    getSceneList1() {
      this.$request
        .get(getSceneList())
        .then((res) => {
          console.log("111111111")
          console.log(res)
          console.log(res.status)
          if (res.status == 200) {
            console.log("222222")
            console.log(res.data)
            const list = res.data.map(item => {
              return {
              label: item,
              value: item 
              }
            })
            console.log(list)
            
            this.options1 = list;
          } else {
            this.$message.error(res.data.msg);
          }
        })
        .catch((e) => {
          this.$message.error('系统异常');
        })
        .finally(() => {});
    },     
  },
  computed: {
    computedWidth() {
      const baseWidth = 222;
      const totalColumns = 10;
      const newWidth = baseWidth / totalColumns;
      return `${newWidth}px`;
    },
  },
};
</script>

<style lang="less" scoped>
@import '@/style/variables.less';

.form-item-content {
  width: 50%;
}

.selected-count {
    display: inline-block;
    margin-left: var(--td-comp-margin-s);
    color: var(--td-text-color-secondary);
  }
.operation-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.operation-ad-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 20px;
}
</style>
